package edu.hitsz.application.game;

import edu.hitsz.application.ImageManager;

/**
 * @author CsCN
 */
public class NormalGame extends AbstractGame {
    private final int baseBossScoreThreshold = 200;
    private final int baseEnemyMaxNumber = 5;

    public NormalGame() {
        super();
        //背景图片
        backgroundImage = ImageManager.NORMAL_BACKGROUND_IMAGE;
        // Boss血量不增加
        bossHpIncrementRate = 0;

        commonEnemyShootNumCircle = 60 * 1000;
        commonEnemyPropertyCircle = 80 * 1000;
        enemyMaxNumberCircle = 80 * 1000;
        elitePossibilityCircle = 60 * 1000;
        bossThresholdCircle = 80 * 1000;
    }

    @Override
    public void updateDifficulty() {
        commonEnemyShootNum = 1 + time / commonEnemyShootNumCircle;
        commonEnemyPropertyRate = 1 + (double) time / commonEnemyPropertyCircle;
        enemyMaxNumber = baseEnemyMaxNumber + time / enemyMaxNumberCircle;
        elitePossibility = 1 - Math.pow(0.5, (double) time / elitePossibilityCircle + 1);
        bossScoreThreshold = (int) (baseBossScoreThreshold * Math.pow(0.5, (double) time / bossThresholdCircle));
        String out = String.format("敌机射击数量: %d, 敌机属性比率: %.4f, 敌机最大数量: %d, 精英敌机生成概率: %.4f, Boss生成阈值: %d",
                commonEnemyShootNum, commonEnemyPropertyRate, enemyMaxNumber, elitePossibility, bossScoreThreshold);
        System.out.println(out);
    }
}
